package com.admin.his.common.algorithm;

public class UUID {

	public static String random32() {
		java.util.UUID uuid = java.util.UUID.randomUUID();
		long leastSigBits= uuid.getLeastSignificantBits();
		long mostSigBits= uuid.getMostSignificantBits();
		return (digits(mostSigBits >> 32, 8)  +
                digits(mostSigBits >> 16, 4) + 
                digits(mostSigBits, 4) + 
                digits(leastSigBits >> 48, 4) + 
                digits(leastSigBits, 12));
	}
	private static String digits(long val, int digits) {
        long hi = 1L << (digits * 4);
        return Long.toHexString(hi | (val & (hi - 1))).substring(1);
    }
	public static String random36() {
		return null;
	}
	public static void main(String[] args) {
		String r=random32();
		System.out.println(r);
	}
}
